package com.qc.wintrax.db;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import greendao.MapAddress;
import greendao.MapInfo;
import greendao.LineName;
import greendao.MarkerInfo;

import com.qc.wintrax.db.MapAddressDao;
import com.qc.wintrax.db.MapInfoDao;
import com.qc.wintrax.db.LineNameDao;
import com.qc.wintrax.db.MarkerInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 *
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig mapAddressDaoConfig;
    private final DaoConfig mapInfoDaoConfig;
    private final DaoConfig lineNameDaoConfig;
    private final DaoConfig markerInfoDaoConfig;

    private final MapAddressDao mapAddressDao;
    private final MapInfoDao mapInfoDao;
    private final LineNameDao lineNameDao;
    private final MarkerInfoDao markerInfoDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);
        mapAddressDaoConfig = daoConfigMap.get(MapAddressDao.class).clone();
        mapAddressDaoConfig.initIdentityScope(type);
        mapInfoDaoConfig = daoConfigMap.get(MapInfoDao.class).clone();
        mapInfoDaoConfig.initIdentityScope(type);
        lineNameDaoConfig = daoConfigMap.get(LineNameDao.class).clone();
        lineNameDaoConfig.initIdentityScope(type);
        markerInfoDaoConfig = daoConfigMap.get(MarkerInfoDao.class).clone();
        markerInfoDaoConfig.initIdentityScope(type);
        mapAddressDao = new MapAddressDao(mapAddressDaoConfig, this);
        mapInfoDao = new MapInfoDao(mapInfoDaoConfig, this);
        lineNameDao = new LineNameDao(lineNameDaoConfig, this);
        markerInfoDao = new MarkerInfoDao(markerInfoDaoConfig, this);
        registerDao(MapAddress.class, mapAddressDao);
        registerDao(MapInfo.class, mapInfoDao);
        registerDao(LineName.class, lineNameDao);
        registerDao(MarkerInfo.class, markerInfoDao);
    }

    public void clear() {
        mapAddressDaoConfig.getIdentityScope().clear();
        mapInfoDaoConfig.getIdentityScope().clear();
        lineNameDaoConfig.getIdentityScope().clear();
        markerInfoDaoConfig.getIdentityScope().clear();
    }

    public MapAddressDao getMapAddressDao() {
        return mapAddressDao;
    }

    public MapInfoDao getMapInfoDao() {
        return mapInfoDao;
    }

    public LineNameDao getLineNameDao() {
        return lineNameDao;
    }

    public MarkerInfoDao getMarkerInfoDao() {
        return markerInfoDao;
    }

}
